package com.mxpio.erp.equipment.service.impl;

import com.mxpio.erp.common.equipment.entity.EquipmentUpkeepDetailParam;
import com.mxpio.erp.common.equipment.service.EquipmentUpkeepDetailParamService;
import com.mxpioframework.jpa.JpaUtil;
import com.mxpioframework.system.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 保养明细选项Service业务层处理
 *
 * @author Cheng
 * @date 2023-07-18
 */
@Service
public class EquipmentUpkeepDetailParamServiceImpl extends BaseServiceImpl<EquipmentUpkeepDetailParam> implements EquipmentUpkeepDetailParamService {

    @Override
    @Transactional(readOnly = true)
    public List<EquipmentUpkeepDetailParam> selectByMainId(String mainId) {
        return JpaUtil.linq(EquipmentUpkeepDetailParam.class).equal("detailId", mainId).list();
    }

    @Override
    @Transactional
    public void deleteByMainId(String mainId) {
        JpaUtil.lind(EquipmentUpkeepDetailParam.class).equal("detailId", mainId).delete();
    }
}
